﻿@using System.Collections;

<style>
    /*左边样式*/
    .leftbox { width: 199px; border-right: solid 1px #cfcdcd; /*border-bottom: solid 1px #414758;*/ }
    .leftbox a { display: block; color: #fff; }
    .leftbox span { display: block; position: absolute; top: 15px; right: 10px; background: url(../../Theme/img/xiala1.png) no-repeat; width: 12px; height: 13px; cursor: pointer; }
    .leftbox ul li p { background: url(../../Theme/img/xiala1.png) no-repeat 165px 16px; height: 45px; line-height: 45px; /*border-bottom: solid 1px #414758;*/ font-size: 14px; }
    .leftbox ul li p a { padding-left: 32px; }
    .leftbox ul li p:hover { background: #009688  url(../../Theme/img/xiala1.png) no-repeat 165px 16px; }
    .leftbox ul li .left_onesub { display: none; max-height: 270px; overflow: hidden; overflow-y: auto; }
    .left_twosub a { height: 40px; line-height: 40px; font-size: 13px; }
    .left_twosub a:hover { color:#009688;}
    .left_twosub dl { display: none; height: auto; background: rgb(87, 91, 103); }
    /*.left_twosub dl dd { border-bottom: solid 1px #414758; }*/
    .left_twosub dl dd a { padding-left: 32px; font-size: 12px; height: 36px; line-height: 36px; margin-right: 0px; border-bottom: none; }
    .leftbox ul li.cur p { background: url(../../Theme/img/xiala2.png) no-repeat 165px 16px #009688; }
    .img_xiala { position: relative;  background:rgba(0,0,0,.3); /*border-bottom: solid 1px #414758;*/ }
    .img_xiala a{ padding-left: 32px;}
    .img_xiala.cur span, .img_xiala.curr span { background: url(../../Theme/img/xiala2.png) no-repeat; }
</style>

<div class="layui-side layui-bg-black">
    <div class="leftbox">
        <ul>
            <li>
                <p><a href="javascript:;" target="">销售中的产品(12)</a></p>
                <div class="left_onesub">
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">全部产品</a>
                            <span></span>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">未分类产品
                            </a>
                            <span></span>
                        </div>
                    </div>

                    @foreach (var item1 in ViewBag.SellerCats)
                    {
                        Hashtable HashTable = (Hashtable)item1;
                        ArrayList arraylist = (System.Collections.ArrayList)HashTable["children"];
                        <div class="left_twosub">
                            <div class="img_xiala">
                                <a href="javascript:;" target="" id ="@HashTable["id"].ToString()">
                                    @HashTable["name"].ToString()
                                </a>
                                <span></span>
                            </div>
                            @if (arraylist.Count > 0)
                            {
                                <dl>
                                    @foreach (var item2 in arraylist)
                                    {
                                        Hashtable hsta = (Hashtable)item2;
                                        string newida = hsta["id"] != null ? (hsta["id"]).ToString() : "";
                                        string newNamea = hsta["name"] != null ? (hsta["name"]).ToString() : "";
                                        <dd>
                                            <a  ids="@newida" href="javascript:;" target="">@newNamea</a>
                                        </dd>
                                    }
                                </dl>
                            }
                        </div>
                    }
                </div>
            </li>
            <li>
                <p><a href="javascript:;" target="">待上架的产品(12)</a></p>
                <div class="left_onesub">
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">全部产品
                            </a>
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <p><a href="javascript:;" target="">审核中(12)</a></p>
            </li>
            <li>
                <p><a href="javascript:;" target="">审核未通过(12)</a></p>
                <div class="left_onesub">
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">未通过
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">已删除
                            </a>
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <p><a href="javascript:;" target="">草稿箱</a></p>
            </li>
            <li>
                <p><a href="javascript:;" target="">产品回收站(12)</a></p>
            </li>
            <li>
                <p><a href="javascript:;" target="">产品备份记录</a></p>
            </li>
            <li>
                <p><a href="javascript:;" target="">还原修改记录</a></p>
                <div class="left_onesub">
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">详情描述
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">产品标题
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">产品价格
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">产品属性
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">产品主图
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">主图顺序
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">可销数量
                            </a>
                        </div>
                    </div>
                    <div class="left_twosub">
                        <div class="img_xiala">
                            <a href="javascript:;" target="">价格区间
                            </a>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</div>

<script type="text/javascript">
    //左侧下拉菜单
    $(function () {
        $(".left_twosub").each(function () {
            if ($(this).find(".img_xiala").hasClass("cur")) {
                $(this).find("dl").show();
            }
        });
        $(".leftbox ul li p").click(function () {
            if ($(this).next().is(":visible")) {
                $(this).parent().removeClass("cur");
                $(this).next().stop(true, true).slideUp("fast");
            }
            else {
                $(".leftbox ul li").removeClass("cur");
                var xiala = $(".img_xiala");
                //if ($(this).parent().find(xiala).length > 0) {
                //    $(this).parent().addClass("cur");
                //}
                $(this).parent().addClass("cur");
                $(this).parent().siblings().find(".left_onesub").stop(true, true).slideUp("fast");
                $(this).next().stop(true, true).slideDown("fast");
            }
        });
        $(".leftbox li").each(function () {
            if ($(".left_onesub", $(this)).length == 0) {
                $("p", $(this)).css("backgroundImage", "none");
            }
        })
        $(".left_twosub").each(function () {
            if ($("dl", $(this)).length == 0) {
                $(".img_xiala span", $(this)).css("backgroundImage", "none");
            }
        })
        $(".left_twosub>.img_xiala span").click(function () {
            var xiala = $(".img_xiala");
            if ($(this).parent().next("dl").is(":visible")) {
                $(this).parent().next("dl").stop(true, true).slideUp("fast");
                $(this).parent().removeClass("curr");
            }
            else {
                $(this).parent().parent().siblings().find("dl").stop(true, true).slideUp("fast");
                $(this).parent().next("dl").stop(true, true).slideDown("fast");
                $(this).parent().addClass("curr");
                $(this).parent().parent().siblings().removeClass("curr");
            }
            $(this).parent().parent().siblings().find(xiala).removeClass("curr");
        });


    });


    //左侧下拉菜单请求数据
    $(function () {
        $(".img_xiala a").click(function () {
            var Searchparameter = new Object();
            Searchparameter["category"] = $(this).attr("id").toString();
            RequestProList(Searchparameter);
        });
    });
</script>


